#include <bits/stdc++.h>

using namespace std;
#define int long long
const int inf = 0x3f3f3f3f;

void solve()
{
    int x, y, a, b, x1, y1, x2, y2;
    cin >> y >> x >> a >> b >> x1 >> y1 >> x2 >> y2;
    if ((y1 != y2 && (y2 - y1) % b == 0) || (x1 != x2 && (x2 - x1) % a == 0)) cout << "YES" << endl;
    else cout << "NO" << endl;
}

signed main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int _ = 1;
    cin >> _;
    while (_--)
    {
        solve();
    }
    return 0;
}